package bat.ke.qq.com;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 回顾servlet 与jsp 执行过程
 * <li>web端，发起get请求</li>
 * <li>业务逻辑处理</li>
 * <li>设置业务model</li>
 * <li>转发至视图处理器</li>
 * <li>基于模板与模型转换输出</li>
 * <li>基于response返回</li>
 */
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html");
        resp.getWriter().write("<h1>hello world</h1>");
    }

}
